package test1230am;

public class Test14 {
    public static void main(String[] args) {
        // (14)定义实现m方法：求数组中最大值
        int[] arr = {1,2,3,4,5};
        int max = m(arr);
        System.out.println(max);
    }
    public static int m(int[] arr) {
        int max = arr[0];
        for (int i = 0 ; i < arr.length ; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        return max;
    }
}
